package com.ruoyi.dishes.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dishes.mapper.TbDishesMapper;
import com.ruoyi.dishes.domain.TbDishes;
import com.ruoyi.dishes.service.ITbDishesService;

/**
 * 菜品Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-24
 */
@Service
public class TbDishesServiceImpl implements ITbDishesService 
{
    @Autowired
    private TbDishesMapper tbDishesMapper;

    /**
     * 查询菜品
     * 
     * @param dishesId 菜品主键
     * @return 菜品
     */
    @Override
    public TbDishes selectTbDishesByDishesId(Long dishesId)
    {
        return tbDishesMapper.selectTbDishesByDishesId(dishesId);
    }

    /**
     * 查询菜品列表
     * 
     * @param tbDishes 菜品
     * @return 菜品
     */
    @Override
    public List<TbDishes> selectTbDishesList(TbDishes tbDishes)
    {
        return tbDishesMapper.selectTbDishesList(tbDishes);
    }

    /**
     * 新增菜品
     * 
     * @param tbDishes 菜品
     * @return 结果
     */
    @Override
    public int insertTbDishes(TbDishes tbDishes)
    {
        return tbDishesMapper.insertTbDishes(tbDishes);
    }

    /**
     * 修改菜品
     * 
     * @param tbDishes 菜品
     * @return 结果
     */
    @Override
    public int updateTbDishes(TbDishes tbDishes)
    {
        return tbDishesMapper.updateTbDishes(tbDishes);
    }

    /**
     * 批量删除菜品
     * 
     * @param dishesIds 需要删除的菜品主键
     * @return 结果
     */
    @Override
    public int deleteTbDishesByDishesIds(Long[] dishesIds)
    {
        return tbDishesMapper.deleteTbDishesByDishesIds(dishesIds);
    }

    /**
     * 删除菜品信息
     * 
     * @param dishesId 菜品主键
     * @return 结果
     */
    @Override
    public int deleteTbDishesByDishesId(Long dishesId)
    {
        return tbDishesMapper.deleteTbDishesByDishesId(dishesId);
    }
}
